<template>
  <div class="Popover">
    <el-form :model="dormDateNew" label-width="200px" size="medium">
      <el-row>
        <el-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
          <el-form-item label="发生单位">
            <el-input v-model="dormDateNew.occurrenceUnit" clearable />
          </el-form-item>
        </el-col>
        <el-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
          <el-form-item label="提出者">
            <el-input v-model="dormDateNew.proposer" clearable />
          </el-form-item>
        </el-col>
        <el-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
          <el-form-item label="品名">
            <el-input v-model="dormDateNew.unitHead" clearable />
          </el-form-item>
        </el-col>
        <el-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
          <el-form-item label="开单日期">
            <el-date-picker
              v-model="dormDateNew.billingDate"
              type="date"
              placeholder="请选择"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
            />
          </el-form-item>
        </el-col>
        <el-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
          <el-form-item label="品名">
            <el-input v-model="dormDateNew.productName" clearable />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>

export default {

  props: ['formdate'],
  data() {
    return {
      dormDateNew: {}
    }
  },
  created() {
    this.refreshForm()
  },
  methods: {
    // 把表单数据传给父组件
    refsfromdated() {
      // 这是最新的值
      console.log(this.dormDateNew)
      this.$emit('FromData', this.dormDateNew)
    },
    // 清空表单数据
    RemoveFromDated() {
      console.log('清空表单数据')
      console.log(this.dormDateNew)
      this.dormDateNew = {}
      console.log(this.dormDateNew)
    },
    // 刷新表单
    refreshForm() {
      this.dormDateNew = this.formdate
    }
  }
}
</script>

<style>

</style>
